<{if $U.uid}>
<table>
    <tr><td>用户名：</td><td><{$U.name}></td></tr>
    <tr><td>余额：</td><td><{$U.money}> 元</td></tr>
    <tr><td>上次登录IP：</td><td><{$U.lastip}></td></tr>
    <tr><td>待付款订单：</td><td><{$U.count}> 个</td></tr>
    <tr><td>购物车：</td><td><{if $smarty.cookies.buycommo}><{$smarty.cookies.buycommo|stripslashes|unserialize|count}><{else}>0<{/if}> 个</td></tr>
    
    <tr><td><a href="<{$config.SITE_URL}>/myhome.php">个人中心</a></td><td><a href="<{$config.SITE_URL}>/cart.php">我的购物车</a></td></tr>
    
    <tr><td><a href="<{$config.SITE_URL}>/ajax.php?action=logout">安全退出</a></td></tr>
</table>
<{else}>
<form>
    <table style="margin-top:40px;position: absolute;margin-left:15px;">
        <tr><td>用户名：</td><td colspan="2"><input type="text" name="username" value=""/></td></tr>
        <tr><td>密  码：</td><td colspan="2"><input type="password" name="pw" value=""/></td></tr>
        <tr><td>验证码：</td><td><input type="text" style="width: 80px;" name="seccode" value=""/></td><td><img src="seccode.php" onclick="this.src='seccode.php?'+Math.random()"/></td></tr>
        <tr>
            <td colspan="3">
                <div align="center">
                <input type="button" value="登陆" class="btn1" id="logsubmit"/>
                <input type="button" value="注册" class="btn1" onclick="window.location.href='<{$config.SITE_URL}>/register.php'"/>
                </div>
            </td>

        </tr>
    </table>
</form>
<script>
    $(function(){
        $("#logsubmit").click(function(){
            var form=$("#logform form");
            username=form.find("input[name='username']").val();
            pw=form.find("input[name=pw]").val();
            seccode=form.find("input[name=seccode]").val();
            
            if(username==""){
                alert('用户名不能为空');
                return false;
            }
            if(pw==""){
                alert('密码不能为空');
                return false;
            }
            if(seccode==""){
                alert('验证码不能为空');
                return false;
            }
            arr={username:username,pw:pw,seccode:seccode,action:'ajax',submit:'submit'};
            $.ajax({
                type:"POST",
                url:"<{$config.SITE_URL}>/login.php",
                dataType:"html",
                cache:false,
                data:arr,
                success:
                    function(html){
                        if(html=='ok'){
                            //$("#logform").load("<{$config.SITE_URL}>/ajax.php?action=getlogform"); 
                            window.location.href=window.location.href;
                        }else{
                            alert(html);
                        }
                    }
            });
        });
        
    })
    
</script>
<{/if}>